Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compat][server][client][test] Global RT DIV improvement (part 2): Chunking support for DIV message #1257

Closed
wants to merge 1 commit into from

Conversation

lluwm
Copy link
Contributor

@lluwm lluwm commented Oct 23, 2024

This change mainly focuses on adding chunking support for DIV messages when they are produced to Kafka topics, as the size of DIV message can be large. We leverage today's chunking mechanism for regular records and extend it to support DIV with the following modifications:

  1. All the DIV messages are of type CONTROL_MESSAGE_DIV in its KafkaKey and their corresponding KafkaMessageEnvelope uses Put as the payload.
  2. Inside the Put payload, the actual message is stored in the putValue field and the schemaId can have the following cases:
    • If the DIV message is non-chunked, the schemaId is set to GLOBAL_DIV_STATE.
    • If the DIV message is chunk message, the schemaId is set to CHUNK.
    • If the DIV message is a chunk manifest message, the schemaId is set to CHUNKED_VALUE_MANIFEST.
  3. ChunkAssembler is adapted, on the receiver side, to buffer, assemble, and deserialize DIV messages (chunked/non-chunked).

How was this PR tested?

  • new integration test.
  • passed CI

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

Copy link

@lusong64 lusong64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments. No need to be a blocker.

@sixpluszero sixpluszero changed the title [compat][server][client][test] Global RT DIV improvement (part 2): Ch… [compat][server][client][test] Global RT DIV improvement (part 2): Chunking support for DIV message Nov 7, 2024
Copy link
Contributor

@sixpluszero sixpluszero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the 2nd part of the change. I missed the first part but I went over the first PR description to make sure I am following. Left some comments but it should be easy to resolve

…unking support for DIV message

This change mainly focuses on adding chunking support for DIV messages when they are produced to Kafka topics,
as the size of DIV message can be large. We leverage today's chunking mechanism for regular records and extend
it to support DIV with the following modifications:

1. All the DIV messages are of type {@link MessageType#CONTROL_MESSAGE_DIV} in its KafkaKey and their corresponding
   KafkaMessageEnvelope uses Put as the payload.
2. Inside the Put payload, the actual message is stored in the putValue field and the schemaId can have the following cases:
   - If the DIV message is non-chunked, the schemaId is set to GLOBAL_DIV_STATE.
   - If the DIV message is chunk message, the schemaId is set to CHUNK.
   - If the DIV message is a chunk manifest message, the schemaId is set to CHUNKED_VALUE_MANIFEST.
3. ChunkAssembler is adapted, on the receiver side, to buffer, assemble, and deserialize DIV messages (chunked/non-chunked).
Comment on lines +458 to +459
this.divChunkAssembler =
builder.getDivChunkAssembler() != null ? builder.getDivChunkAssembler() : new ChunkAssembler(storeName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.divChunkAssembler =
builder.getDivChunkAssembler() != null ? builder.getDivChunkAssembler() : new ChunkAssembler(storeName);

nit: Can this be achieved by just reusing chunkAssembler? They seem the same to me, other than the unit test access via builder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could internal ChunkAssembler.inMemoryStorageEngine have a conflict if use the same instance?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not impossible, but I think a conflict is improbable if the key is something very specific

@KaiSernLim
Copy link
Contributor

Continuing the PR in #1385.

@KaiSernLim KaiSernLim closed this Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants